// 通过改变APIV1参数来切换mock模式，开发：/api/screen; Mock: /api/v1（ 见：mock/_utils.js）
// const ecityUrl = 'http://61.182.245.67:8099/ServiceEngine/rest/services'
const ecityUrl = '/ServiceEngine/rest/services'
const APIV1 = `${ecityUrl}`;

// APIV2
const APIV2 = `/api/screen`

module.exports = {
  name: 'oni-dva-umi-demo',
  CORS: [],
  /* Layout configuration, specify which layout to use for route. */
  openPages: ['/login'],
  apiPrefix: APIV1,
  ecityUrl: ecityUrl,
  APIV1,
  api: {
    // 工程管理
    projectIndicators: `${APIV1}/zdServer/api/screen/project/getIndicators`, // 指标项
    projectAnalysis: `${APIV1}/zdServer/api/screen/project/getAnalysis`,     // 分析
    // 营业管理
    reportIncoming: `/api/report/getIncomingReport`, // 缴费来源
    reportWaterUse: `/api/report/sumWaterQtyByUseTypeAndDateRange`, // 用水类型分析
    reportSumYearPay: '/api/report/sumYearPayStatusByYearRange', // 收费分析
    sumCurrentMonthPay: '/api/report/sumCurrentMonthPayStatusOnYear', // 获取当月，上一个月，去年同月的营销数据
    // 远传水表
    watermeterIndicators: `${APIV1}/zdServer/api/screen/watermeter/getIndicators`,
    // Scada调度系统 - (Token)
    ScadeHdStationList: `/scade/hd/station/list.json`, // 站点列表
    ScadeUbizRealtimetemplateQuery: `/scade/ubiz/realtimetemplate/query.json`, // 获取模板所有列
    ScadaRealtimetemplateQuery: `/scade/scada/realtimetemplate/query.json`,  // 获取片区实时数据
    ScadeStationList: `/scade/hd/station/detail.json`, // 历史数据
    ScadeYLdata: `/scade/agile/overview/getYLdata.json`, // 压力分析
    // Scada调度系统 - (DdToken)
    ScadeDivisionWater: `/hd/division/water.json`, // 售水供水详情接口
    ScadeDivisionCopyrate: `/hd/division/copyrate.json`, // 抄见详情接口
    ScadeStationAlarm: `/hd/station/alarm.json`, // 报警列表
    // 远传水表集成管理平台（http://61.182.245.67:8087）
    cmrOverviewInfo: `/cmr/realtime/overview/info.json`, // 区域总览
    crmVillageleakQuery: `/cmr/report/villageleak/query.json`, // 漏水分析
    crmRealtimeWater3: `/cmr/realtime/jloverview/getwater3.json`, // 计量总览 - 统计
    crmRealtimeMeter3: `/cmr/realtime/jloverview/getmeter3.json`, // 计量总览 - 异常
    // 大量分析-远传大口径流量计(结算型)
    crmMaxGetaccount: `/api/account/maxGetaccount`,
    // 巡检维修
    MaintenanceIndicators: `${APIV1}/workorderService/screen/getIndicators`,            // 指标
    MaintenanceAnalysis: `${APIV1}/workorderService/screen/inspection/getAnalysis`,     // 分析
    MaintenanceStatistics: `${APIV1}/workorderService/screen/inspection/getStatistics`, // 统计
    // 客服热线
    HotlineIndicators: `${APIV2}/hotline/getIndicators`, // 指标，http://61.182.245.67:8014/
    HotlineAnalysis: `${APIV2}/hotline/analysis`,     // 分析
    HotlineStatistics: `${APIV2}/hotline/statistics`, // 统计
    HotlineGetAnalysis: `${APIV2}/hotline/getAnalysis`,     // 分析
    HotlineGetStatistics: `${APIV2}/hotline/getStatistics`,     // 分析
    // e-city 集众智，展鸿图
    ECityQuery: `${APIV1}/NetServer/zdzls/1/query`,     // 查询
    ECityIdentify: `${APIV1}/NetServer/zdzls/identify`, // gis管网设备,取type=4
    ECityMetas: `${APIV1}/NetServer/zdzls/metas`,       // 元数据
    // 手动维护
    ECityMonitorMetas: `/api/manual${APIV1}/NetServer/monitor`,    //
    ECityWaterQualityIndicators: `/api/manual${APIV1}/zdServer/getWaterQualityIndicators`,    // 水质指标监测情况
    ECityWaterQualityIndicatorsByYear: `/api/manual${APIV1}/zdServer/getWaterQualityIndicatorsByYear`,    // 水质指标分析
    ECityQualityIndicatorsAnalysis: `/api/manual${APIV1}/zdServer/waterQualityIndicatorsAnalysis`,    // 水质检测情况分析
    ECityExceedingStandardAnalysis: `/api/manual${APIV1}/zdServer/exceedingStandardAnalysis`,    // 超标情况占比分析
    // 用户登录
    getUserInfo: `/ServiceEngine/rest/userService/login`
  },
  // 远传水表集成管理平台
  CMR: {
    Token: "5d5e3d9ed87f63056449d8db",
    villageList: [
      { cm_id: "5d4a6ac7d87f63156000cd66", name: "众美小区", type: 'line' },
      { cm_id: "5d4a6be1d87f63156000cd75", name: "天山熙湖", type: 'line' },
      { cm_id: "5d4a6c81d87f63156000cd7f", name: "宝能中心", type: 'line' },
      { cm_id: "5d4a6c40d87f63156000cd7a", name: "福美小区", type: 'line' },    
    ],
    // 远传水表异常表占比
    AlarmStation: [
      { name: '瑞泉', realname: '瑞泉电子', type: 'line' },
      { name: '竞达', realname: '竟达电子', type: 'line' },
      { name: '汇中', realname: '汇中仪表', type: 'line' },
      { name: '东海', realname: '宁波东海', type: 'line' },
    ],
  },
  
  // Scada调度系统
  scada: {
    Token: "5d5cae0f3daecf13f4b3bd2a",     // 调度Token
    DdToken: "5d5e3d9ed87f63056449d8db",   // 远传水表Token
    StationIds: {
      // 源水量： 由 1#、2#、3#深水泵房 累计
      'source': ['5d418e1f3daecf014816435b', '5d418e3e3daecf014816435d', '5d418e683daecf0148164361'],
      // 供水量： 由 送水泵房
      'supply': ['5d418edd3daecf0148164367'],
      // 药耗： 加药间
      'drug': ['5d4195ab3daecf01481643c8'],
      // 大用户
      'maxuser': ['5d5893793daecf13f4b39753'],
    },
    STypes: ["5d3967b33daecf0f50b9952b", "5d3967b33daecf0f50b9952a"],
    // DTypes类型
    DTypes:  ["SSLL","ZXLJ","FXLJ","SJLJ","YL","ZD","YuL","PH","SCCS","MZKG","UPS","YW","DCDY","SD","JRLL","ZRLL","BYLL","BNLL","BZLL","ZRTQ","LS","SHIDU","WD","KD","DIANLIANG","BZT","BJ","SL","HBLL","XSL","PL","FMZT","GZZT","KZLX","CQL","QY","YX","CW","QS","COD","RJY","DDL","GSL"],
    // 在线检测 - 水厂（地下水厂：103水厂stations）
    waterStations: ["5d418edd3daecf0148164367"],
    SupplyId: 'HD76_103_P1', // 今日累计送水量
    Interval: 86400, // 数据返回间隔，天
    IntervalMonth: 2592000, // 月

    // scade调度系统配置，在另一个数据库里重新部署需要修改配置
    realtimetemplate:[
      // 水厂
      {
        value: 'sc',
        title: '水厂',
        serverType: 'hd_station_list',
        payload: {
          Stations: ["5d418edd3daecf0148164367"],
          DTypes: ["SSLL","ZXLJ","FXLJ","SJLJ","YL","ZD","YuL","PH","SCCS","MZKG","UPS","YW","DCDY","SD","JRLL","ZRLL","BYLL","BNLL","BZLL","ZRTQ","LS","SHIDU","WD","KD","DIANLIANG","BZT","BJ","SL","HBLL","XSL","PL","FMZT","GZZT","KZLX","CQL","QY","YX","CW","QS","COD","RJY","DDL","GSL"],
          From: 0,
          Size: 99999
        }
      },
      // 压力监控
      {
        title: '压力',
        // 接口请求类型：/scada/realtimetemplate/query.json
        serverType: 'scada_realtimetemplate_query',
        // 数据来源：配置模板 - 代号
        value: 'yljk',
        payload: {
          // 数据类型，"YL" 压力
          DTypes: ["YL"],
          // 数据来源：tree.json 获取，对应各级分区
          Divisions: [["5d5e6d843daecf17e88d7275", "5d5e6dad3daecf17e88d7276"]],
        }
      },
      // 水质监控
      {
        title: '水质',
        serverType: 'scada_realtimetemplate_query',
        value: 'szjk',
        payload: {
          DTypes: ["ZD", "YuL"],
          Divisions: [["5d5e6d843daecf17e88d7275", "5d638ae73daecf17e88d9fd9"]],
        },
      },
      // 二供泵房
      {
        value: 'egbf',
        title: '二供泵房',
        serverType: 'hd_station_list',
        payload: {
          Stations: ["5d41aeab3daecf0148164515"],
          DTypes: ["SSLL","ZXLJ","FXLJ","SJLJ","YL","ZD","YuL","PH","SCCS","MZKG","UPS","YW","DCDY","SD","JRLL","ZRLL","BYLL","BNLL","BZLL","ZRTQ","LS","SHIDU","WD","KD","DIANLIANG","BZT","BJ","SL","HBLL","XSL","PL","FMZT","GZZT","KZLX","CQL","QY","YX","CW","QS","COD","RJY","DDL","GSL"],
          From: 0,
          Size: 99999
        }
      },
      // 流量监控
      {
        title: '流量',
        serverType: 'scada_realtimetemplate_query',
        value: 'lljk',
        payload: {
          DTypes: ["SJLJ", "SSLL"],
          Divisions: [["5d5e6d843daecf17e88d7275", "5d5e6dc33daecf17e88d727a"]]
        }
      },
    ],
    // 在线监测 - 重点指标
    realtimeIndicators: [
      // 流量监控
      {
        label: '流量计监测点',
        icon: 'waterworks',
        serverType: 'scada_realtimetemplate_query',
        value: 'lljk',
        payload: {
          DTypes: ["SJLJ", "SSLL"],
          Divisions: [["5d5e6d843daecf17e88d7275", "5d5e6dc33daecf17e88d727a"]]
        }
      },
      // 压力监控
      {
        label: '压力监测点',
        icon: 'dashboard',
        // 接口请求类型：/scada/realtimetemplate/query.json
        serverType: 'scada_realtimetemplate_query',
        // 数据来源：配置模板 - 代号
        value: 'yljk',
        payload: {
          // 数据类型，"YL" 压力
          DTypes: ["YL"],
          // 数据来源：tree.json 获取，对应各级分区
          Divisions: [["5d5e6d843daecf17e88d7275", "5d5e6dad3daecf17e88d7276"]],
        }
      },
      // 水质监控
      {
        label: '水质监测点',
        icon: 'quality',
        serverType: 'scada_realtimetemplate_query',
        value: 'szjk',
        payload: {
          DTypes: ["ZD", "YuL"],
          Divisions: [["5d5e6d843daecf17e88d7275", "5d638ae73daecf17e88d9fd9"]],
        },
      },
      // 二供泵房
      {
        value: 'egbf',
        label: '二次供水泵房',
        icon: 'pump-station',
        serverType: 'hd_station_list',
        payload: {
          Stations: ["5d41aeab3daecf0148164515"],
          DTypes: ["SSLL","ZXLJ","FXLJ","SJLJ","YL","ZD","YuL","PH","SCCS","MZKG","UPS","YW","DCDY","SD","JRLL","ZRLL","BYLL","BNLL","BZLL","ZRTQ","LS","SHIDU","WD","KD","DIANLIANG","BZT","BJ","SL","HBLL","XSL","PL","FMZT","GZZT","KZLX","CQL","QY","YX","CW","QS","COD","RJY","DDL","GSL"],
          From: 0,
          Size: 99999
        }
      },
    ]
  }
}
